package org.soarsky.wealthchengdu.google.map;

import java.security.KeyStore.LoadStoreParameter;

import android.location.Location;


public class LocationPoint extends BasePoint{
	private float accuracy = 0f;
	private float bearing = 0f;
	private boolean isBraring = false;
	private boolean isAccuracy = false;
	private String address = null;
	public LocationPoint(){}
	public LocationPoint(double latitude,double longitude,float accuracy,float bearing){
		super(0, latitude, longitude);
		this.accuracy = accuracy;
		this.bearing = bearing;
		isAccuracy = true;
		isBraring = true;
		
	}
	public LocationPoint(Location location,String address) {
		if (location == null) return;
		this.setId(0);
		this.setLatitude(location.getLatitude());
		this.setLongitude(location.getLongitude());
		if (location.hasAccuracy()) {
			setAccuracy(location.getAccuracy());
		}
		if (location.hasBearing()) {
			setBearing(location.getBearing());
		}
		if(address!=null)
			setAddress(address);
	}
	public float getAccuracy() {
		return accuracy;
	}
	public void setAccuracy(float accuracy) {
		this.accuracy = accuracy;
		isAccuracy = true;
	}
	public float getBearing() {
		return bearing;
	}
	public void setBearing(float bearing) {
		this.bearing = bearing;
		isBraring = true;
	}
	public void removeBraring () {
		isBraring = false;
	}
	public void removeAccuracy() {
		isAccuracy = false;
	}
	public boolean hasBearing() {
		return isBraring;
	}
	public boolean hasAccuracy() {
		return isAccuracy;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
}
